package org.example.smartbuy.serviceImpl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.example.smartbuy.entity.Productactions;
import org.example.smartbuy.entity.Products;
import org.example.smartbuy.mapper.ProductactionsMapper;
import org.example.smartbuy.service.IProductactionsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Smarty Buy
 * @since 2024-11-18
 */
@Service
public class ProductactionsServiceImpl extends ServiceImpl<ProductactionsMapper, Productactions> implements IProductactionsService {
    @Autowired
    private ProductactionsMapper productactionsMapper;


    @Override
    public List<Productactions> listAll() {
        return productactionsMapper.selectList(null);
    }

    @Override
    public Productactions add(Productactions productactions) {
        productactionsMapper.insert(productactions);
        return productactions;
    }

    @Override
    public void delete(int id) {
        productactionsMapper.deleteById(id);
    }
}
